package cn.jy.erp.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.jy.erp.mapper.BaseMapper;
import cn.jy.erp.service.IBaseService;
@Service
public class BaseServiceImpl<T> implements IBaseService<T> {
      
	@Autowired
	BaseMapper<T> baseMapper;
	
	@Override
	public void add(T t) {
		baseMapper.save(t);
		
	}

	@Override
	public void del(Serializable id) {
		baseMapper.remove(id);			
	}

	@Override
	public void update(T t) {
		baseMapper.update(t);
	}

	@Override
	public T getById(Serializable id) {
		return baseMapper.loadById(id);
	}

	@Override
	public List<T> getAll() {
		return baseMapper.loadAll();
	}

}
